<!DOCTYPE html PUBLIC "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd>
<html>
	<head>
		<link rel="stylesheet" type="test/css" href="css/pageacceuil.css"/>
		<link rel="stylesheet" type="test/css" href="css/reset.css"/>
		<title> FreeBED project </title>
		<meta charset= "UTF-8" />
	</head>
	
	<body>
		<div id="header">
			<header class="background_alpha">
				<center><h1>FreeBED</h1></center>
			</header>
			<hr/>
		</div>
		
		<center>
			
			<div id="menu" class="border background_alpha">
				<div id="login">
					<?php
						if(isset($infos))
						{
							echo "<a href='freebed-logout.php'>Deconnexion</a>";
						}
						else
						{
							echo "<a href='freebed-login.php'>Login</a> ";
							echo "<a href='freebed-register.php'>S'enregistrer</a>";
						}
					?>
				</div>
				<div id="search" style="margin-top: 5px;">
					<a href="freebed-search.php">Recherche Avancée</a>
				</div>
			</div>	
			
			<div id="conteneur" class="border background_alpha">
				
				<div id="profil" class="border">
					<?php
						if(isset($infos))
						{
							echo "<img src='$infos[3]' style='margin-top: 150px; margin-bottom: 5px; width:150px; height:150px;'/>";
							echo "<p>Bienvenue, $infos[0] $infos[1]</p><br/>";
							if($infos[2] == 0)
								echo "<p>Status : Utilisateur</p>";
							else
							{
								echo "<p>Status : Bailleur</p>";
								echo "<p>Nombre de biens en ligne : $infos[4]</p>";
								echo "<br/><a href='freebed-panel.php'>Voir / Modifiez vos biens</a>";
							}
							echo "<br/><a href='freebed-add.php'>Mettre un bien en ligne</a>";
							echo "<br/><a href='freebed-moduser.php'>Modifier votre profil</a>";
						}
					?>
				</div>
				
				<div id="offre" class="border">
					<?php echo "<img style='width: 150px; height: 150px;' src='$image'/><br/><br/>"; ?>
					<form style="margin-top: 25px;" id="loginform" name="loginform" action="freebed-detail.php" method="post"><table border="1" width="300">
						<?php
							if($data[1] == $id)
								echo "<p>Modifier le bien</p>";
							else
								echo "<p>Detail du bien</p>";
						?>
						<br/><br/>
						<table border="1" width="500">
							<tr>
								<td>Surface (m²)</td>
								<td>
									<?php
										if($data[1] == $id)
											echo "<input type='text' name='surface' id='surface' value='$data[4]'/>";
										else
											echo "<p>$data[4]</p>";
									?>
								</td>
							</tr>
							<tr>
								<td>Adresse</td>
								<td>
									<?php
										if($data[1] == $id)
											echo "<input type='text' name='adresse' id='adresse' value='$data[5]'/>";
										else
											echo "<p>$data[5]</p>";
									?>
								</td>
							</tr>
							<tr>
								<td>Ville</td>
								<td>
									<?php
										if($data[1] == $id)
											echo "<input type='text' name='ville' id='ville' value='$ville[1]'/>";
										else
											echo "<p>$ville[1]</p>";
									?>
								</td>
							</tr>		
							<tr>
								<td>Code Postal</td>
								<td>
									<?php
										if($data[1] == $id)
											echo "<input type='text' name='cp' id='cp' value='$data[6]'/>";
										else
											echo "<p>$data[6]</p>";
									?>
								</td>	
							</tr>
							<tr>
								<td>Tarifs par jour (€)</td>
								<td>
								<?php
										if($data[1] == $id)
											echo "<input type='text' name='prix1' id='prix1' value='$data[7]'/>";
										else
											echo "<p>$data[7]</p>";
									?>
								</td>
							</tr>
							<tr>
								<td>Tarifs par semaine (€)</td>
								<td>
								<?php
										if($data[1] == $id)
											echo "<input type='text' name='prix1' id='prix1' value='$data[8]'/>";
										else
											echo "<p>$data[8]</p>";
									?>
								</td>
							</tr>
							<tr>
								<td>Status</td>
								<td>
									<select name="online" id="online">
										<option value="0" >en ligne</option>
										<option value="1">en attente</option>
									</select>
								</td>
							<tr>
								<td colspan="2">
									<textarea placeholder="Entrez une description" name="description" style="width:500px;"></textarea>
								</td>
							</tr>
							<tr>
								<td colspan="2" align="center"><input type="submit" name="envoyer" value="Envoyez" /></td>
							</tr>
						</table>
					</form>
				</div>
			
			</div>
		
		</center>
			
		<center>
			<div id="footer" class="border background_alpha">
				<center>&copy; Poney</center>
			</div>
		</center>
	</body>
</html>